import 'package:citiesocial/_include.dart';

class HorizonalGoods extends BaseStatelessWidget {
  final List<GoodsEntity> goodsList;

  HorizonalGoods(this.goodsList);

  @override
  Widget build(BuildContext context) => Container(
        child: SingleChildScrollView(
          scrollDirection: Axis.horizontal,
          child: Row(
            children: List.generate(
                goodsList.length == null ? 0 : goodsList.length, (index) {
              return Container(
                child: SquareGoodsItem(
                  goodsList[index],
                  imageHeight: 160.0,
                  imageWidth: 150.0,
                ),
                margin: EdgeInsets.symmetric(horizontal: 5.0),
              );
            }),
          ),
        ),
        margin: EdgeInsets.only(
          left: 10.0,
          right: 10.0,
          top: 5.0,
          bottom: 5.0,
        ),
      );
}
